<template>
  <a-spin :spinning="confirmLoading">
    <a-row style="margin-bottom: 0;" v-if="model.canEdit">
      <a-col :span="24" style="text-align: right;padding-right:16px">
        <a-button v-has="'assetMessage:delete'" type="primary" @click="handleEdit">
          编辑
        </a-button>
        <a-popconfirm style="margin-left: 8px;" v-has="'assetMessage:edit'" placement="leftBottom" :title="'确定删除，资产' + this.model.assetName+'（' + this.model.assetCode+'）吗？'" @confirm="() => handleDelete()">
          <a-button type="danger" >
            删除
          </a-button>
        </a-popconfirm>
      </a-col>
    </a-row>
    <j-form-container :disabled="formDisabled">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-tabs default-active-key="1">
          <a-tab-pane key="1" tab="基础信息">
            <a-row>
              <a-col :span="12">
                <a-form-model-item label="资产编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetCode">
                  {{ model.assetCode || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="资产名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetName">
                  {{ model.assetName || '-' }}
                </a-form-model-item>
              </a-col>
            </a-row>
            <!-- 空间资产相关 -->
            <a-row v-if="model.type==='1'">
              <a-col :span="12">
                <a-form-model-item label="资产类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetType">
                  {{ model.assetType_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="空间类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spaceType">
                  {{ model.spaceType_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="空间子类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spaceSubtype">
                  {{ model.spaceSubtype_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="所属资产" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="belongAsset">
                  {{ model.belongAsset_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="所属公司" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="company">
                  {{ model.company_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="place">
                  {{ model.place || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="资产状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
                  {{ model.status_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargePerson">
                  {{ model.chargePerson || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="不动产权力人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remainderman">
                  {{ model.remainderman || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeMobile">
                  {{ model.chargeMobile || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="实物图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="physicalImage">
                  <j-image-upload  v-if="model.physicalImage" :disabled="true" v-model="model.physicalImage" ></j-image-upload>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
            </a-row>
            <!-- 设备资产相关 -->
            <a-row v-if="model.type==='2'">
              <a-col :span="12">
                <a-form-model-item label="资产类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetType">
                  {{ model.assetType_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="设备分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentCategory">
                  {{ model.equipmentCategory_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="所属空间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="belongSpaceCode">
                  {{ model.belongSpaceCode_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="所属资产" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="belongAsset">
                  {{ model.belongAsset_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="所属公司" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="company">
                  {{ model.company_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="存放位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="place">
                  {{ model.place || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="资产状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
                  {{ model.status_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargePerson">
                  {{ model.chargePerson || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeMobile">
                  {{ model.chargeMobile || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="实物图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="physicalImage">
                  <j-image-upload  v-if="model.physicalImage" :disabled="true" v-model="model.physicalImage" ></j-image-upload>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
            </a-row>
          </a-tab-pane>
        </a-tabs>
        <!-- 仅空间资产显示 -->
        <span v-if="model.type==='1'">
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="物理属性">
              <a-col :span="12">
                <a-form-model-item label="建筑面积（㎡）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buildingArea">
                  {{ model.buildingArea || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="可租面积（㎡）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rentableArea">
                  {{ model.rentableArea || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="楼层信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="floorInfo">
                  {{ model.floorInfo || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="装修信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="renovation">
                  {{ model.renovation || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="建成日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="completionYear">
                  {{ model.completionYear || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="停车位数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parkingNum">
                  {{ model.parkingNum || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="电梯数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elevatorNum">
                  {{ model.elevatorNum || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="配套设施" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supportFacility">
                  {{ model.supportFacility || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="价值和权属">
              <a-col :span="12">
                <a-form-model-item label="权属主体" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ownershipSubject">
                  {{ model.ownershipSubject || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="取得方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="acquisitionMethod">
                  {{ model.acquisitionMethod_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="账面原值（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bookOriginalValue">
                  {{ model.bookOriginalValue || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="账面净值（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bookNetValue">
                  {{ model.bookNetValue || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="折旧起始年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="depreciationStartDate">
                  {{ model.depreciationStartDate || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="月折旧额（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="monthDepreciationFee">
                  {{ model.monthDepreciationFee || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="权证办理状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certificateStatus">
                  {{ model.certificateStatus_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="资产类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isFixedAsset">
                  {{ model.isFixedAsset_dictText || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="经营状况">
              <a-col :span="12">
                <a-form-model-item label="经营单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operationUnit">
                  {{ model.operationUnit || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="可否对外招租" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="canRent">
                  {{ model.canRent_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="已租面积（㎡）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="rentedArea">
                  {{ model.rentedArea || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="参考租金（元/㎡/月）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="referenceRent">
                  {{ model.referenceRent || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="年度收入（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annualIncome">
                  {{ model.annualIncome || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="物业管理">
              <a-col :span="12">
                <a-form-model-item label="管理单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyCompany">
                  {{ model.propertyCompany || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="能源费（元/月/㎡）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="energyFee">
                  {{ model.energyFee || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="车位费（元/月）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parkingFee">
                  {{ model.parkingFee || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="物业费单价（元/月/㎡）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="propertyFeeUnit">
                  {{ model.propertyFeeUnit || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="年物业费（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annualPropertyFee">
                  {{ model.annualPropertyFee || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="空房管理费（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="vacantManagementFee">
                  {{ model.vacantManagementFee || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="关联设施系统">
              <a-col :span="12">
                <a-form-model-item label="视频监控系统" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="videoSurveillance">
                  {{ model.videoSurveillance || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="门禁安防系统" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accessControl">
                  {{ model.accessControl || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="核心动转设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coreOperationEquipment">
                  {{ model.coreOperationEquipment || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="网络情况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="networkCondition">
                  {{ model.networkCondition || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="机房" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="machineRoom">
                  {{ model.machineRoom || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="控制室" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="controlRoom">
                  {{ model.controlRoom || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="设备房" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentRoom">
                  {{ model.equipmentRoom || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="其他资料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="otherData">
                  {{ model.otherData || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="关联文档">
              <a-col :span="12">
                <a-form-model-item label="不动产权证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certEstateRight">
                  <j-upload-view  v-if="model.certEstateRight" v-model="model.certEstateRight"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="土地使用证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certLandUse">
                  <j-upload-view v-if="model.certLandUse" v-model="model.certLandUse"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="建设工程备案证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certConstructionRecord">
                  <j-upload-view v-if="model.certConstructionRecord" v-model="model.certConstructionRecord"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="规划许可证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certPlanningPermit">
                  <j-upload-view v-if="model.certPlanningPermit" v-model="model.certPlanningPermit"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="消防验收证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certFireInspection">
                  <j-upload-view v-if="model.certFireInspection" v-model="model.certFireInspection"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="环保验收证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="certEnvironmentalInspection">
                  <j-upload-view v-if="model.certEnvironmentalInspection" v-model="model.certEnvironmentalInspection"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="平面图纸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docLayoutDrawing">
                  <j-upload-view v-if="model.docLayoutDrawing" v-model="model.docLayoutDrawing"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="CAD图纸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docCadDrawing">
                  <j-upload-view v-if="model.docCadDrawing" v-model="model.docCadDrawing"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="招商资料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docInvestment">
                  <j-upload-view v-if="model.docInvestment" v-model="model.docInvestment"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="其他资料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docOther">
                  <j-upload-view v-if="model.docOther" v-model="model.docOther"></j-upload-view>
                  <span v-else>-</span>
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
        </span>
        <span v-if="model.type==='2'">
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="技术规格">
              <a-col :span="12">
                <a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
                  {{ model.brand || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
                  {{ model.model || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="技术参数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technicalParams">
                  {{ model.technicalParams || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="制造商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturer">
                  {{ model.manufacturer || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="国别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="country">
                  {{ model.country || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="出厂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factorySerial">
                  {{ model.factorySerial || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="出厂日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryDate">
                  {{ model.factoryDate || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="采购与价值">
              <a-col :span="12">
                <a-form-model-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplier">
                  {{ model.supplier || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="采购日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purchaseDate">
                  {{ model.purchaseDate || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="合同编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="contractCode">
                  {{ model.contractCode || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="账面原值（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bookOriginalValue">
                  {{ model.bookOriginalValue || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="账面净值（元）" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bookNetValue">
                  {{ model.bookNetValue || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="折旧起始年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="depreciationStartDate">
                  {{ model.depreciationStartDate || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="保修截止日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warrantyEndDate">
                  {{ model.warrantyEndDate || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="维修信息">
              <a-col :span="12">
                <a-form-model-item label="维修状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceStatus">
                  {{ model.maintenanceStatus_dictText || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="维修服务商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCompany">
                  {{ model.maintenanceCompany || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="维修合同" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairContract">
                  {{ model.repairContract || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="上次维修日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastMaintenanceDate">
                  {{ model.lastMaintenanceDate || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="下次维修日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nextMaintenanceDate">
                  {{ model.nextMaintenanceDate || '-' }}
                </a-form-model-item>
              </a-col>
              <a-col :span="12">
                <a-form-model-item label="检验日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectDate">
                  {{ model.inspectDate || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="关联文档">
              <a-row>
                <a-col :span="12">
                  <a-form-model-item label="设备档案/说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docEquipmentFile">
                    <j-upload-view v-if="model.docEquipmentFile" v-model="model.docEquipmentFile"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item label="图纸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docDrawing">
                    <j-upload-view v-if="model.docDrawing" v-model="model.docDrawing"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item label="权属证件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docOwnership">
                    <j-upload-view v-if="model.docOwnership" v-model="model.docOwnership"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item label="使用许可证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docOperationPermit">
                    <j-upload-view v-if="model.docOperationPermit" v-model="model.docOperationPermit"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item label="检验合格证" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docInspectionCert">
                    <j-upload-view v-if="model.docInspectionCert" v-model="model.docInspectionCert"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
                <a-col :span="12">
                  <a-form-model-item label="其他资料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="docOther">
                    <j-upload-view v-if="model.docOther" v-model="model.docOther"></j-upload-view>
                    <span v-else>-</span>
                  </a-form-model-item>
                </a-col>
              </a-row>
            </a-tab-pane>
          </a-tabs>
        </span>
        <a-row>
          <!-- <a-col :span="12">
            <a-form-model-item label="资产编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetCode">
              <a-input v-model="model.assetCode" placeholder="请输入资产编码"  ></a-input>
            </a-form-model-item>
          </a-col> -->
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="其他">
              <a-col :span="12">
                <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
                  {{ model.remark || '-' }}
                </a-form-model-item>
              </a-col>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="关联合同">
              <a-table
                ref="tableCon"
                size="middle"
                :scroll="{x:true}"
                bordered
                rowKey="id"
                :columns="model.canEdit ? columnsCon : columnsConDis"
                :dataSource="dataSourceCon"
                :pagination="ipaginationCon"
                class="j-table-force-nowrap"
                @change="conTableChange">
                <span slot="action" slot-scope="text, record">
                  <a @click="handleDetail(record)">详情</a>
                </span>
              </a-table>
            </a-tab-pane>
          </a-tabs>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="变更历史">
              <a-table
                ref="tableItem"
                size="middle"
                :scroll="{x:true}"
                bordered
                rowKey="id"
                :columns="columnsItem"
                :dataSource="dataSourceItem"
                :pagination="ipaginationItem"
                class="j-table-force-nowrap"
                @change="itemTableChange">
              </a-table>
            </a-tab-pane>
          </a-tabs>
        </a-row>
      </a-form-model>
    </j-form-container>
    <asset-contract-info-view-modal ref="modalView2"></asset-contract-info-view-modal>
  </a-spin>
</template>

<script>

  import { validateDuplicateValue } from '@/utils/util'
  import { deleteAction, getAction,downFile,httpAction } from '@/api/manage'
  import JUploadView from '@/components/jeecg/JUploadView'
  // import AssetContractInfoViewModal from './AssetContractInfoViewModal'
  

  export default {
    name: 'AssetMessageViewForm',
    components: {
      // AssetContractInfoViewModal
      JUploadView
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
          type: '1'
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
           assetCode: [
              { required: true, message: '请输入资产编码!'},
           ],
           assetName: [
              { required: true, message: '请输入资产名称!'},
           ],
          //  chargePerson: [
          //     { required: true, message: '请输入负责人!'},
          //  ],
          //  chargeMobile: [
          //     { required: true, message: '请输入负责人联系电话!'},
          //  ],
           company: [
              { required: true, message: '请选择所属公司!'},
           ],
           belongSpaceCode: [
              { required: true, message: '请选择所属空间!'},
           ],
           completionYear: [
              { required: true, message: '请选择建成日期!'},
           ],
           purchaseDate: [
              { required: true, message: '请选择采购日期!'},
           ],
           spaceType: [
              { required: true, message: '请选择空间类型!'},
           ],
           belongAsset: [
              { required: true, message: '请选择所属资产!'},
           ],
        },
        url: {
          add: "/asset/assetMessage/add",
          edit: "/asset/assetMessage/edit",
          queryById: "/asset/assetMessage/queryById",
          delete: "/asset/assetMessage/delete",
          changeList: "/asset/assetMessageChange/list",
          conList: "/asset/assetContractInfo/queryByAsset",
        },
        columnsItem: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'操作人',
            align:"center",
            dataIndex: 'createBy_dictText'
          },
          {
            title:'操作时间',
            align:"center",
            dataIndex: 'createTime'
          },
          {
            title:'变更字段',
            align:"center",
            dataIndex: 'changeFieldName'
          },
          {
            title:'旧值',
            align:"center",
            dataIndex: 'oldValue'
          },
          {
            title:'新值',
            align:"center",
            dataIndex: 'newValue'
          }
        ],
        dataSourceItem:[],
        /* 分页参数 */
        ipaginationItem:{
          current: 1,
          pageSize: 10,
          pageSizeOptions: ['10', '20', '30'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        columnsCon: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'合同编号',
            align:"center",
            dataIndex: 'contractCode'
          },
          {
            title:'合同名称',
            align:"center",
            dataIndex: 'contractName'
          },
          {
            title:'合同类型',
            align:"center",
            dataIndex: 'contractType_dictText'
          },
          {
            title:'合同金额（元）',
            align:"center",
            dataIndex: 'contractAmount'
          },
          {
            title:'合同开始日期',
            align:"center",
            dataIndex: 'contractStartDate',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'合同结束日期',
            align:"center",
            dataIndex: 'contractEndDate',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:80,
            scopedSlots: { customRender: 'action' }
          }
        ],
        columnsConDis: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'合同编号',
            align:"center",
            dataIndex: 'contractCode'
          },
          {
            title:'合同名称',
            align:"center",
            dataIndex: 'contractName'
          },
          {
            title:'合同类型',
            align:"center",
            dataIndex: 'contractType_dictText'
          },
          {
            title:'合同金额（元）',
            align:"center",
            dataIndex: 'contractAmount'
          },
          {
            title:'合同开始日期',
            align:"center",
            dataIndex: 'contractStartDate',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'合同结束日期',
            align:"center",
            dataIndex: 'contractEndDate',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          }
        ],
        dataSourceCon:[],
        /* 分页参数 */
        ipaginationCon:{
          current: 1,
          pageSize: 10,
          pageSizeOptions: ['10', '20', '30'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
      this.$options.components.AssetContractInfoViewModal = require('./AssetContractInfoViewModal').default
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.model = Object.assign({}, record);
        this.dataSourceItem = [];
        this.dataSourceCon = [];
        this.loadItemList();
        this.loadConList();
        this.visible = true;
      },
      submitForm () {
        
      },
      handleEdit(){
        this.$emit('edit', this.model);
      },
      handleDelete(){
        deleteAction(this.url.delete, {id: this.model.id}).then((res) => {
          if (res.success) {
            this.$message.success(res.message);
            this.$emit('ok');
          } else {
            this.$message.warning(res.message);
          }
        });
      },
      loadItemList(){
        var params = {pageNo: this.ipaginationItem.current, pageSize: this.ipaginationItem.pageSize, pid: this.model.id};
        // this.loadingItem = true;
        getAction(this.url.changeList, params).then((res) => {
          if (res.success) {
            this.dataSourceItem = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipaginationItem.total = res.result.total;
            }else{
              this.ipaginationItem.total = 0;
            }
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          // this.loadingItem = false
        })
      },
      itemTableChange(pagination, filters, sorter){
        this.ipaginationItem.current = pagination.current;
        this.ipaginationItem.pageSize = pagination.pageSize;
        this.loadItemList();
      },
      loadConList(){
        var params = {pageNo: this.ipaginationCon.current, pageSize: this.ipaginationCon.pageSize, id: this.model.id};
        // this.loadingItem = true;
        getAction(this.url.conList, params).then((res) => {
          if (res.success) {
            this.dataSourceCon = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipaginationCon.total = res.result.total;
            }else{
              this.ipaginationCon.total = 0;
            }
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          // this.loadingItem = false
        })
      },
      conTableChange(pagination, filters, sorter){
        this.ipaginationCon.current = pagination.current;
        this.ipaginationCon.pageSize = pagination.pageSize;
        this.loadConList();
      },
      handleDetail:function(record){
        this.$refs.modalView2.edit(record);
        this.$refs.modalView2.title="合同详情";
        this.$refs.modalView2.disableSubmit = true;
      },
    }
  }
</script>
<style scoped>

</style>